# +----------------------------------------------------------------------
# | Pink [ A modern python web framework ]
# +----------------------------------------------------------------------
# | Copyright (c) 2023 http:#unnnnn.com All rights reserved.
# +----------------------------------------------------------------------
# | Author: chenjianhua <unnnnn@foxmail.com>
# +----------------------------------------------------------------------


import subprocess

from .Task import Task


class CommandTask(Task):
    run_every_minute = True

    def __init__(self, command=""):
        self.command = command

    def handle(self):
        subprocess.call(self.command.split(" "))
